/*
 * @Title: 标题
 * @Description: 描述
 * @FilePath: /vue3-starter/uno.config.ts
 */
// uno.config.ts
import {
  defineConfig,
  presetAttributify,
  presetIcons,
  presetTypography,
  presetUno,
  presetWebFonts,
  transformerDirectives,
  transformerVariantGroup
} from 'unocss'

export default defineConfig({
  shortcuts: {
    'flex-center': 'flex justify-center items-center',
    bordered: 'border border-style-solid border-color-border_color',
    'border-top': 'b-t b-t-solid border-color-border_color',
    'border-right': 'b-r b-r-solid border-color-border_color',
    'border-bottom': 'b-b b-b-solid border-color-border_color',
    'border-left': 'b-l b-l-solid border-color-border_color'
  },
  theme: {
    colors: {
      primary: 'var(--el-color-primary)',
      primary_dark: 'var(--el-color-primary-light-5)',
      border_color: 'var(--el-border-color)',
      danger: 'var(--el-color-danger)'
    }
  },
  rules: [
    [/^bc-(.+)$/, ([, color]) => ({ 'border-color': `#${color}` })],
    [/^br-(.+)$/, ([, r]) => ({ 'border-radius': `${r}` })]
  ],
  presets: [
    presetUno(),
    presetAttributify(),
    presetIcons(),
    presetTypography(),
    presetWebFonts({
      fonts: {
        // ...
      }
    })
  ],
  transformers: [transformerDirectives(), transformerVariantGroup()]
})
